<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%><%@ page import="hyl.core.db.MyDB"%><%@ page 
	import="hyl.My,hyl.core.MyFun,java.io.IOException"%><%@ page 
	import="java.util.List,java.util.Map,java.sql.Connection,java.math.BigDecimal"%><% 
response.setCharacterEncoding("UTF-8");  
response.setContentType("text/plain");  
MyDB db = My.getDb1();
	String sql1 = "select * from manageadd where userid=? and state=1";
	String[] param = new String[1];
	param[0] =request.getParameter("userid"); 
	
	List<Map<String, Object>> list = db.queryList(sql1, param); 

	if (list.size()>0){
		MyDB db2 = My.getDb1();
		db2.setCloseAuto(false);
		String sql2 = "update manageadd set state=0  where userid=? and id=?";
		for (Map<String, Object> m : list) {
			int id=(Integer)m.get("id");			
			Object[] param2 = new Object[2];
			param2[0] =request.getParameter("userid"); 
			param2[1] =id; 
			db2.executeUpdate(sql2, param2);
		}		
		db2.closeAll();
	} 
		
%>